package com.ruoyi.db.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.UUID;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SseEvent {
    private String eventId;
    private String eventType;
    private Object data;
    private String message;
    private Long timestamp;
    
    public static SseEvent of(String eventType, Object data, String message) {
        return SseEvent.builder()
                .eventId(UUID.randomUUID().toString())
                .eventType(eventType)
                .data(data)
                .message(message)
                .timestamp(System.currentTimeMillis())
                .build();
    }
}